<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>5.5.3 v-else-if</title>
</head>
<body>
    <div id="app">
        <button v-on:click="getAge">点我呀</button><span>{{age}}</span>
        <p v-if="age <= 3">儿童</p>
        <p v-else-if="age <=6">少年</p>
        <p v-else>青年</p>
    </div>

    <!--<script src="node_modules/vue/dist/vue.js"></script>-->
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- 生产环境版本，优化了尺寸和速度 -->
    <!--<script src="https://cdn.jsdelivr.net/npm/vue"></script>-->
    <script type="text/javascript">
        var app = new Vue({
            el:"#app",
            data:{
                age:0
            },
            methods:{
                getAge:function(){
                    this.age = Math.floor(Math.random() * 10 + 1);
                }
            }

        });
    </script>
</body>
</html>